package nccloud.impl.ftm.framect.self;

import java.util.Map;

import nc.impl.pubapp.pattern.data.bill.BillQuery;
import nc.impl.pubapp.pattern.data.vo.VOQuery;
import nc.impl.pubapp.pattern.data.vo.VOUpdate;
import nc.vo.ftm.contract.AggContractVO;
import nc.vo.ftm.contract.ContractVO;
import nc.vo.pub.BusinessException;

public class FramectMaintainServiceImpl {
	
	public AggContractVO ticketTapeContract(Map<String, Object> params) throws BusinessException {
		String pk_contract_h = (String) params.get("pk_customer");
		VOQuery<ContractVO> query = new VOQuery<ContractVO>(ContractVO.class);
		ContractVO[] hvos = query.query(new String[] {pk_contract_h});
		VOUpdate<ContractVO> update = new VOUpdate<ContractVO>();
		for(ContractVO hvo : hvos) {
			hvo.setDef2("3");
			hvo.setDef3((String) params.get("ticketdate"));
			hvo.setDef4((String) params.get("ticketno"));
		}
		hvos = update.update(hvos, new String[] {"def2", "def3", "def4"});
		BillQuery<AggContractVO> billquery = new BillQuery<AggContractVO>(AggContractVO.class);
		return billquery.query(new String[] {pk_contract_h}) [0];
	}

}
